Skip multipart parts with empty Content-Type instead of raising - #3
Open
magicmark wants to merge 3 commits into
Open
Skip multipart parts with empty Content-Type instead of raising#3magicmark wants to merge 3 commits into
magicmark wants to merge 3 commits into
Conversation
magicmark
force-pushed
the
fix-empty-content-type-heartbeat
branch
from
June 30, 2026 05:45
51d74b1 to
01926fa
Compare
magicmark
force-pushed
the
fix-empty-content-type-heartbeat
branch
3 times, most recently
from
June 30, 2026 06:02
1ff86bc to
d0d2600
Compare
Some GraphQL servers send multipart parts without a Content-Type header as heartbeats or keep-alive padding. Previously this raised a TransportProtocolError, crashing the subscription stream. Co-Authored-By: Claude <noreply@anthropic.com>
magicmark
force-pushed
the
fix-empty-content-type-heartbeat
branch
from
June 30, 2026 20:02
2b12b85 to
058f95c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multipart HTTP streams may contain empty parts (no headers, no body):
(In our case, we see this (I think) due to being passed through multiple proxies which unpack and pack parts back together)
Anyway our current handling is too strict — it required every part to have
Content-Type: application/jsoninstead of just skipping empty ones.Before
When this happens, applications see traceback like this:
After
✨ empty parts are ignored; no errors